Skip to content

feat(csharp): run the model authoring lints in dotnet meta verify - #635

Merged
dmealing merged 8 commits into
mainfrom
fm/mo-130-lane-csharp-6
Nov 22, 2026
Merged

dmealing merged 8 commits into
mainfrom
fm/mo-130-lane-csharp-6

Conversation

@dmealing

@dmealing dmealing commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • dotnet meta verify now prints the three advisory model authoring lints to stderr, before the field lint, in the same order as Node meta verify: overlay (WARN_OVERLAY_IMPLICIT), node names (WARN_NAME_SURROUNDING_WHITESPACE, WARN_NAME_INTERNAL_WHITESPACE) and deprecated references (WARN_DEPRECATED_REFERENCE). They never change the exit code. Each is muted by --no-overlay-lint, --no-name-lint, --no-deprecation-lint or its META_NO_*_LINT=1 variable.
  • The shared raw-document parser moved out of FieldLint.cs into RawDocument.cs, and the new lints use it with LintFinding and ModelLints. The field lint's output is unchanged.
  • TypeScript: the deprecated-reference message now ends its sentence before Replaced by … when the reason has no terminal punctuation. The overlay lint accepts a Pick of the collection instead of the full type. fixtures/model-lint-conformance/ is a new corpus that both the C# and TS ports run, and the CLI docs and CHANGELOG are updated to match.
Validation

Risk Assessment

✅ Low: The change adds advisory-only lints that never reach the exit code, backed by a shared corpus and CLI-level tests. The merge in this run only resolved CHANGELOG, AGENTS, CONFORMANCE and site-payload conflicts, and the corpus count of 46 matches the fixture directories.

Testing

Baseline configured test command passed at the target commit and was not re-run because no source changed this turn. The strict-load fix from test round 1 is in HEAD (ed1e603). Drove the freshly built C# dotnet meta verify CLI on three disposable synthetic models: clean strict load prints all three advisory lints and exits 0; strict load failure on an unregistered attr exits 1 with the name and deprecation lints silent, as the contract requires; --lax on the same model prints all three lints and exits 0. Overall result: all three pass live.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
S1: dotnet meta verify on a clean strict-loading model prints the overlay, name and deprecation advisories and exits 0 (synthetic model, built CLI) ✅ pass live transcript S1 section; exit=0 with WARN_OVERLAY_IMPLICIT, WARN_NAME_SURROUNDING_WHITESPACE, WARN_DEPRECATED_REFERENCE printed
S2 (adversarial): strict load failure on an unregistered @bogusAttr keeps names and deprecation lints silent and exits non-zero (synthetic model, built CLI) ✅ pass live transcript S2 section; exit=1, load error ERR_UNKNOWN_ATTR, no names:/deprecations: sections, overlay section still printed
S3: --lax on the same model loads it and prints all three advisory sections with exit 0 (synthetic model, built CLI) ✅ pass live transcript S3 section; exit=0 with overlays, names and deprecations sections printed
Evidence: Live model-lint transcript: strict clean (S1), strict load failure (S2), lax (S3)
# S1 clean strict load: exit 0, three advisory sections
dotnet meta verify — overlays: 1 unflagged cross-file redeclaration(s) (advisory — does not fail the build):
  WARN_OVERLAY_IMPLICIT: app::Owner is redeclared in meta.app.ui.json without overlay: true — add the flag so a removed or renamed target fails loudly (ERR_OVERLAY_NO_TARGET) instead of silently becoming a new object
dotnet meta verify — names: 1 authoring warning(s) (advisory — does not fail the build):
  WARN_NAME_SURROUNDING_WHITESPACE [app::Legacy."label "]: field.string name "label " has leading or trailing whitespace, which is almost certainly unintended — rename it (to "label", presumably), and pin @column if the physical column must keep its name. The whitespace is carried into every identifier, column and wire key derived from the name.
dotnet meta verify — deprecations: 1 reference(s) to a deprecated node (advisory — does not fail the build):
  WARN_DEPRECATED_REFERENCE [app::Item]: extends deprecated object.entity app::Legacy: use Item

# S2 strict load failure (@bogusAttr): exit 1, names/deprecations silent, overlay still prints
  hint: verify loads strict by default (ADR-0023): an unregistered or typo'd @attr is ERR_UNKNOWN_ATTR. To fix: register the attr on a metadata provider, OR move arbitrary author-supplied properties into an `attr.properties` bag, OR run 'dotnet meta verify --lax' to keep the legacy open-attr load.
  load error: ERR_UNKNOWN_ATTR
dotnet meta verify — overlays: 1 unflagged cross-file redeclaration(s) (advisory — does not fail the build):
  WARN_OVERLAY_IMPLICIT: app::Owner is redeclared in meta.app.ui.json without overlay: true — add the flag so a removed or renamed target fails loudly (ERR_OVERLAY_NO_TARGET) instead of silently becoming a new object

# S3 --lax on same model: exit 0, all three sections print
dotnet meta verify — overlays: 1 unflagged cross-file redeclaration(s) (advisory — does not fail the build):
  WARN_OVERLAY_IMPLICIT: app::Owner is redeclared in meta.app.ui.json without overlay: true — add the flag so a removed or renamed target fails loudly (ERR_OVERLAY_NO_TARGET) instead of silently becoming a new object
dotnet meta verify — names: 1 authoring warning(s) (advisory — does not fail the build):
  WARN_NAME_SURROUNDING_WHITESPACE [app::Legacy."label "]: field.string name "label " has leading or trailing whitespace, which is almost certainly unintended — rename it (to "label", presumably), and pin @column if the physical column must keep its name. The whitespace is carried into every identifier, column and wire key derived from the name.
dotnet meta verify — deprecations: 1 reference(s) to a deprecated node (advisory — does not fail the build):
  WARN_DEPRECATED_REFERENCE [app::Item]: extends deprecated object.entity app::Legacy: use Item
  • Outcome: 🔧 1 issue found → no changes applied ✅ across 2 runs (47m28s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

🔧 **Test** - 1 issue found → no changes applied ✅
  • 🚨 configured test command failed with exit code 1
  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
S3 strict verify rejects unregistered @bogusAttr and keeps lints silent (live, local CLI, synthetic model) ✅ pass live verify-lint-strict-live.txt S3 block: exit=1, 'load error: ERR_UNKNOWN_ATTR', no names:/deprecations: sections; only overlay advisory printed
S1 verify --lax on same model loads and prints name and deprecation lints (live, local CLI, synthetic model) ✅ pass live verify-lint-strict-live.txt S1 block: exit=0, names: 1 WARN_NAME_SURROUNDING_WHITESPACE, deprecations: 1 WARN_DEPRECATED_REFERENCE
S2 clean metadata strict verify exits 0 with no lint sections (live, local CLI, synthetic model) ✅ pass live verify-lint-strict-live.txt S2 block: exit=0, stdout 'dotnet meta verify --templates: OK', stderr empty
  • scripts/ci-local.sh --affected --strict-toolchains
  • Built dotnet meta CLI: dotnet build server/csharp/MetaObjects.Cli/MetaObjects.Cli.csproj -c Release -o $DEV_SCRATCH/mo-cli
  • S3 live: dotnet mo-cli/MetaObjects.Cli.dll verify <bogus-model> --templates --prompts <templates> (strict default) on a disposable model with @bogusAttr, overlay, name-whitespace and deprecated-reference findings
  • S1 live: same model with --lax
  • S2 live: verify on a clean disposable model (overlay flagged, no whitespace, no deprecation)
  • dotnet test server/csharp/MetaObjects.Cli.Tests/MetaObjects.Cli.Tests.csproj (464 passed, 0 failed, includes VerifyModelLintTests strict-load case)
  • Full regression: dotnet test server/csharp/MetaObjects.sln (exit 0: Render 367, Conformance 2906, Codegen 1895 + 1 skipped, Cli 464; 0 failed)
  • Scratch fixtures and build output removed under $DEV_SCRATCH; worktree git status clean.

🔧 No changes applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
S1: dotnet meta verify on a clean strict-loading model prints the overlay, name and deprecation advisories and exits 0 (synthetic model, built CLI) ✅ pass live transcript S1 section; exit=0 with WARN_OVERLAY_IMPLICIT, WARN_NAME_SURROUNDING_WHITESPACE, WARN_DEPRECATED_REFERENCE printed
S2 (adversarial): strict load failure on an unregistered @bogusAttr keeps names and deprecation lints silent and exits non-zero (synthetic model, built CLI) ✅ pass live transcript S2 section; exit=1, load error ERR_UNKNOWN_ATTR, no names:/deprecations: sections, overlay section still printed
S3: --lax on the same model loads it and prints all three advisory sections with exit 0 (synthetic model, built CLI) ✅ pass live transcript S3 section; exit=0 with overlays, names and deprecations sections printed
  • scripts/ci-local.sh --affected --strict-toolchains
  • Baseline: scripts/ci-local.sh --affected --strict-toolchains (configured test command, passed at target commit 20a38b282f; not re-run, no source changed)
  • Confirmed fix commit ed1e6036ac is an ancestor of HEAD; read server/csharp/MetaObjects.Cli/ModelLints.cs (RunAdvisory strict param, meta.Load(strict)) and Program.cs:677 (strict: !lax)
  • dotnet build server/csharp/MetaObjects.Cli/MetaObjects.Cli.csproj -c Release -o /mnt/scratch/mo130-lint/cli (built CLI into scratch, 0 errors)
  • S1: dotnet MetaObjects.Cli.dll verify <clean-model> --templates <t> --prompts <t> -> exit 0, overlays/names/deprecations sections printed
  • S2: same verify on model with unregistered @bogusAttr (strict default) -> exit 1, ERR_UNKNOWN_ATTR load error, names and deprecations sections absent, overlay section still printed
  • S3: same model with --lax -> exit 0, all three advisory sections printed
  • Transcript saved to evidence dir; scratch build and fixtures removed; worktree git status clean
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

fixtures/model-lint-conformance/ (18 cases) pins the codes, addresses and
message text of the three advisory model authoring lints verify prints:
WARN_OVERLAY_IMPLICIT, WARN_NAME_SURROUNDING_WHITESPACE /
WARN_NAME_INTERNAL_WHITESPACE and WARN_DEPRECATED_REFERENCE. The corpus is
byte-identical to the Python lane's copy, so whichever lands second rebases
cleanly. The corpora count moves to 44 and CONFORMANCE.md gains its row.
dotnet meta verify now prints the three model authoring lints Node meta
verify has: WARN_OVERLAY_IMPLICIT, WARN_NAME_SURROUNDING_WHITESPACE /
WARN_NAME_INTERNAL_WHITESPACE and WARN_DEPRECATED_REFERENCE, in the Node
order (overlays, names, deprecations) before the field lint. They are
advisory, never change the exit code, and each is muted by its own
--no-*-lint flag or META_NO_*_LINT=1.

The raw-document reader moves out of FieldLint into RawDocument and now
reads booleans (overlay: true), keeping the text YAML wrote so a field
literally named true still reads as a name. ModelLintConformanceTests runs
the shared fixtures/model-lint-conformance/ corpus; VerifyModelLintTests
drives the built CLI for the order, the flags and the variables.
@dmealing
dmealing merged commit e681e77 into main Nov 22, 2026
10 checks passed
@dmealing
dmealing deleted the fm/mo-130-lane-csharp-6 branch November 22, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant